
const path=require("path")
const fs=require("fs")
//导入dotenv 加载.env
const dotenv=require("dotenv")
//加载,env文件 都放在process中
dotenv.config()
//因为返回的是对象 所以能解构
const {APP_PORT,APP_HOST,MYSQL_HOST,MYSQL_PORT,MYSQL_DATABASE,MYSQL_ROOT,MYSQL_PASSWORD}=process.env
 
//获取所在的文件夹夹文件名子
const PRIVATE_KEY=fs.readFileSync(path.resolve(__dirname,"./keys/private.key"))
const PUBLIC_KEY=fs.readFileSync(path.resolve(__dirname,"./keys/public.key"))
const UPLOAD_PATH="./uploads/avatar"
const PICTURE_PATH="./uploads/picture"
module.exports={
    APP_PORT,
    MYSQL_HOST,
    MYSQL_PORT,
    MYSQL_DATABASE,
    MYSQL_ROOT,
    MYSQL_PASSWORD,
    APP_HOST
}
module.exports.PRIVATE_KEY=PRIVATE_KEY;
module.exports.PUBLIC_KEY=PUBLIC_KEY;
module.exports.UPLOAD_PATH=UPLOAD_PATH;
module.exports.PICTURE_PATH=PICTURE_PATH;